package service.configuration.xstream;

import java.util.List;

import service.configuration.IBlockConfig;
import service.configuration.IFieldConfig;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("block")
public class BlockConfig implements IBlockConfig {
	String label;
	
	@XStreamImplicit(itemFieldName="field", keyFieldName="field")
	private List<IFieldConfig> fields;
	
	public BlockConfig(String label, List<IFieldConfig> fields) {
		this.label = label;
		this.fields = fields;
	}
	
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public List<IFieldConfig> getFieldConfigs() {
		return fields;
	}
	public void setFieldConfigs(List<IFieldConfig> fields) {
		this.fields = fields;
	}
	public void addFieldConfig(IFieldConfig fieldConfig) {
		this.fields.add(fieldConfig);
	}
}
